<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>电影详情页</title>
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <!-- 样式 -->
    <link rel="stylesheet" href="../../css/style.css"/>
    <!-- 主题（主要颜色设置） -->
    <link rel="stylesheet" href="../../css/theme.css"/>
    <!-- 通用的css -->
    <link rel="stylesheet" href="../../css/common.css"/>
    <link rel="stylesheet" href="../../xznstatic/css/bootstrap.min.css">
</head>
<style>
    html::after {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        content: '';
        display: block;
        background-attachment: fixed;
        background-size: cover;
        background-position: center;
        z-index: -1;
    }

    #swiper {
        overflow: hidden;
    }

    #swiper .layui-carousel-ind li {
        width: 16px;
        height: 10px;
        border-width: 0;
        border-style: solid;
        border-color: rgba(0, 0, 0, .3);
        border-radius: 3px;
        background-color: #f7f7f7;
        box-shadow: 0 0 6px rgba(255, 0, 0, .8);
    }

    #swiper .layui-carousel-ind li.layui-this {
        width: 26px;
        height: 10px;
        border-width: 0;
        border-style: solid;
        border-color: rgba(0, 0, 0, .3);
        border-radius: 6px;
        box-shadow: 0 0 6px rgba(255, 0, 0, .8);
    }

    input#buynumber::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }

    input#buynumber[type="number"] {
        -moz-appearance: textfield;
    }

    .message-container {
        width: 100%
    }

    .data-detail {
        padding-bottom: 20px;
    }

    .data-detail .layui-breadcrumb a.first {
        color: rgba(14, 14, 14, 1) !important;
    }</style>
<body>

<div id="app">
        <div class="data-detail">
            <div class="sub_backgroundColor data-detail-breadcrumb" :style='{"padding":"0 10px","boxShadow":"0 0 0px rgba(255,0,0,.3)","margin":"20px auto","borderColor":"rgba(135, 206, 250, 1)","borderRadius":"4px","borderWidth":"0","borderStyle":"solid","height":"54px"}'>
                <span class="layui-breadcrumb">
                    <a class="first" :style='{"padding":"8px 10px","boxShadow":"0 0 6px rgba(255,0,0,0)","margin":"0 5px","borderColor":"rgba(255,0,0,.3)","backgroundColor":"rgba(255, 255, 255, 0)","color":"rgba(14, 14, 14, 1)","borderRadius":"0","borderWidth":"0","fontSize":"16px","borderStyle":"solid"}' href="../home/home.html">
                        首页
                    </a>
                    <a>
                        <cite :style='{"padding":"8px 15px","boxShadow":"0 0 0px rgba(255,0,0,.3)","margin":"0 15px","borderColor":"rgba(255,0,0,.3)","backgroundColor":"rgba(255, 255, 255, 0)","color":"rgba(129, 84, 118, 1)","borderRadius":"4px","borderWidth":"0","fontSize":"16px","borderStyle":"solid"}'>
                            {{title}}
                        </cite>
                    </a>
                </span>
                        <a v-if='storeupFlag' class="main_backgroundColor" :style='{"padding":"0 12px","boxShadow":"0 0 0px rgba(255,0,0,.3)","borderColor":"rgba(255,0,0,.3)","color":"rgba(255, 255, 255, 1)","borderRadius":"4px","borderWidth":"0","fontSize":"16px","lineHeight":"34px","borderStyle":"solid"}' @click="addDianyingCollection()" href="javascript:void(0)">
                    <i class="layui-icon" style="font-size: 20px;color: red;" v-if='true' :style='{"color":"rgba(255, 255, 255, 1)","padding":"0 2px 0 0","fontSize":"18px"}'>&#xe67a;</i>取消收藏
                </a>
                <a v-if='!storeupFlag' class="main_backgroundColor" :style='{"padding":"0 12px","boxShadow":"0 0 0px rgba(255,0,0,.3)","borderColor":"rgba(255,0,0,.3)","color":"rgba(255, 255, 255, 1)","borderRadius":"4px","borderWidth":"0","fontSize":"16px","lineHeight":"34px","borderStyle":"solid"}' @click="addDianyingCollection()" href="javascript:void(0)">
                    <i class="layui-icon" style="font-size: 20px;color: red;" v-if='true' :style='{"color":"rgba(255, 255, 255, 1)","padding":"0 2px 0 0","fontSize":"18px"}'>&#xe67b;</i>点我收藏
                </a>
            </div>
            <div class="layui-row" style="display: flex">
                <div class="layui-col-md5" style="width:420px">
                    <div class="layui-carousel " id="swiper" :style='{"boxShadow":"0 0 2px rgba(160, 67, 26, 1)","margin":"0 auto","borderColor":"rgba(0,0,0,.3)","borderRadius":"6px","borderWidth":"0","width":"420px","borderStyle":"solid","height":"400px"}'>
                        <div carousel-item>
                            <div v-if="swiperList.length" v-for="(item,index) in swiperList" :key="index">
                                <img style="width: 100%;height: 100%;object-fit:cover;" :src="item"/>
                            </div>
                        </div>
                    </div>

                    <div class="tool-container">
                        <!-- 没有赞 没有踩 -->
                        <div v-if="zanFlag == 0 && caiFlag == 0" @click="zanNumberClick()" style="display: flex;align-items: center;">
                            <i class="layui-icon" style="font-size: 20px;color: red;margin-right: 10px;">&#xe6af;</i>
                            赞一下({{detail.zanNumber}})
                        </div>
                        <div v-if="zanFlag == 0 && caiFlag == 0" @click="caiNumberClick()" style="display: flex;align-items: center;">
                            <i class="layui-icon" style="font-size: 20px;color: red;margin-right: 10px;">&#xe69c;</i>
                            踩一下({{detail.caiNumber}})
                        </div>

                        <!-- 已赞 -->
                        <div v-if="zanFlag == 1" @click="zanNumberClick()" style="display: flex;align-items: center;">
                            <i class="layui-icon" style="font-size: 20px;color: red;margin-right: 10px;">&#xe6af;</i>
                            已赞({{detail.zanNumber}})
                        </div>

                        <!-- 已踩 -->
                        <div v-if="caiFlag == 1" @click="caiNumberClick()" style="display: flex;align-items: center;">
                            <i class="layui-icon" style="font-size: 20px;color: red;margin-right: 10px;">&#xe6af;</i>
                            已踩({{detail.caiNumber}})
                        </div>
                    </div>
                </div>
                <div class="layui-col-md7 sub_borderColor" style="padding-left: 20px;flex: 1;" :style='{"padding":"0","boxShadow":"0 0 0px rgba(255,0,0,0)","margin":"0 0 0 20px","backgroundColor":"#fff","borderRadius":"0","borderWidth":"1px","borderStyle":"solid"}'>
                <h1 style="position: relative;" :style='{"padding":"10px 15px","boxShadow":"0 0 0px rgba(255,0,0,.3)","borderColor":"rgba(160, 67, 26, 1)","backgroundColor":"#fff","color":"#333","borderRadius":"0","textAlign":"center","borderWidth":"0px","fontSize":"18px","borderStyle":"solid"}' class="title">
                    {{title}}
                </h1>
                    <div class="detail-item main_borderColor" :style='{"padding":"6px 15px","backgroundColor":"#fff","borderRadius":"0","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
                        <span :style='{"padding":"0 12px 0 0","minWidth":"110px","fontSize":"14px","color":"#333","textAlign":"left"}'>
                            电影类型：
                        </span>
                        <span class="desc" style="word-break: break-all" :style='{"padding":"5px 15px","boxShadow":"0 0 0px rgba(255,0,0,.3)","borderColor":"rgba(135, 206, 250, 1)","backgroundColor":"#fff","color":"#333","borderRadius":"4px","textAlign":"left","borderWidth":"0","width":"auto","lineHeight":"24px","fontSize":"14px","borderStyle":"solid"}' >
                            {{detail.dianyingValue}}
                        </span>
                    </div>
                    <div v-if="detail.dianyingOldMoney" class="detail-item main_borderColor" :style='{"padding":"6px 15px","backgroundColor":"#fff","borderRadius":"0","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
                        <span :style='{"padding":"0 12px 0 0","minWidth":"110px","fontSize":"14px","color":"#333","textAlign":"left"}'>
                            原价：
                        </span>
                        <span style="word-break: break-all" :style='{"padding":"5px 15px","boxShadow":"0 0 0px rgba(255,0,0,.3)","borderColor":"rgba(135, 206, 250, 1)","backgroundColor":"#fff","color":"#333","borderRadius":"4px","textAlign":"left","borderWidth":"0","width":"auto","lineHeight":"24px","fontSize":"14px","borderStyle":"solid"}' class="desc">
                            {{detail.dianyingOldMoney}}
                        </span>
                    </div>
                    <div v-if="detail.dianyingNewMoney" class="detail-item main_borderColor" :style='{"padding":"6px 15px","backgroundColor":"#fff","borderRadius":"0","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
                        <span :style='{"padding":"0 12px 0 0","minWidth":"110px","fontSize":"14px","color":"#333","textAlign":"left"}'>
                            现价：
                        </span>
                        <span style="word-break: break-all" :style='{"padding":"5px 15px","boxShadow":"0 0 0px rgba(255,0,0,.3)","borderColor":"rgba(135, 206, 250, 1)","backgroundColor":"#fff","color":"#333","borderRadius":"4px","textAlign":"left","borderWidth":"0","width":"auto","lineHeight":"24px","fontSize":"14px","borderStyle":"solid"}' class="desc">
                            {{detail.dianyingNewMoney}}
                        </span>
                    </div>
                    <div v-if="detail.zanNumber" class="detail-item main_borderColor" :style='{"padding":"6px 15px","backgroundColor":"#fff","borderRadius":"0","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
                        <span :style='{"padding":"0 12px 0 0","minWidth":"110px","fontSize":"14px","color":"#333","textAlign":"left"}'>
                            赞：
                        </span>
                        <span style="word-break: break-all" :style='{"padding":"5px 15px","boxShadow":"0 0 0px rgba(255,0,0,.3)","borderColor":"rgba(135, 206, 250, 1)","backgroundColor":"#fff","color":"#333","borderRadius":"4px","textAlign":"left","borderWidth":"0","width":"auto","lineHeight":"24px","fontSize":"14px","borderStyle":"solid"}' class="desc">
                            {{detail.zanNumber}}
                        </span>
                    </div>
                    <div v-if="detail.caiNumber" class="detail-item main_borderColor" :style='{"padding":"6px 15px","backgroundColor":"#fff","borderRadius":"0","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
                        <span :style='{"padding":"0 12px 0 0","minWidth":"110px","fontSize":"14px","color":"#333","textAlign":"left"}'>
                            踩：
                        </span>
                        <span style="word-break: break-all" :style='{"padding":"5px 15px","boxShadow":"0 0 0px rgba(255,0,0,.3)","borderColor":"rgba(135, 206, 250, 1)","backgroundColor":"#fff","color":"#333","borderRadius":"4px","textAlign":"left","borderWidth":"0","width":"auto","lineHeight":"24px","fontSize":"14px","borderStyle":"solid"}' class="desc">
                            {{detail.caiNumber}}
                        </span>
                    </div>
                    <div class="detail-item main_borderColor" :style='{"padding":"6px 15px","backgroundColor":"#fff","borderRadius":"0","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
                        <button @click="addDianyingOrder()" style="height:auto;" :style='{"padding":"0 10px","boxShadow":"0 0 0px rgba(255,0,0,.3)","margin":"0 5px","borderColor":"rgba(0,0,0,.3)","backgroundColor":"rgba(23, 124, 176, 1)","color":"rgba(255, 255, 255, 1)","borderRadius":"6px","borderWidth":"0","width":"auto","lineHeight":"40px","fontSize":"16px","borderStyle":"solid"}' type="button" class="layui-btn btn-submit">
                            立即购买
                        </button>
                    </div>
                   <!-- <div class="detail-item main_borderColor" :style='{"padding":"6px 15px","backgroundColor":"#fff","borderRadius":"0","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
                        <button :style='{"margin":"0 5px","borderColor":"rgba(0,0,0,.3)","color":"rgba(255, 255, 255, 1)","borderRadius":"4px","borderWidth":"0","width":"auto","lineHeight":"34px","fontSize":"14px","borderStyle":"solid"}'
                                @click="onAcrossTap('dingdan')" type="button" class="layui-btn sub_backgroundColor sub_borderColor">
                            预定
                        </button>
                    </div>-->
                </div>
            </div>

                <!-- 座位 -->
            <div class="seat-list" :style='{"padding":"10px 0 10px 0","boxShadow":"0 0 5px var(--publicMainColor, #808080)","margin":"10px 0 0 0","backgroundColor":"rgba(255, 255, 255, 1)","borderRadius":"20px","borderWidth":"0","borderStyle":"solid"}'>
                <div style="width: 100%">
                    <span style="font-size: 40px;float: left;margin-left: 1%;width: 25%;">座位列表</span>
                    <span style="float: right;width: 73%;margin-top: 12px;margin-right: 1%;">
                        <span style="width: 20%;">订购日期：</span>
                        <el-date-picker style="width:35%" v-model="buyZuoweiTime" :picker-options="buyZuoweiTimeOptions" @change ="zuoweiChange" type="date" placeholder="选择日期"></el-date-picker>
                    </span>
                </div>
                <label style="background: var(--publicMainColor);width:1000px;height: 1px;margin: 10px 0px 10px"></label>
                <div v-for="(item,index) in zuoweiNumberList " v-bind:key="index" class="seat-item">
                    <img @click="selectTip()"        v-if="item.select"         class="seat-icon" src="../../img/select.png"        />
                    <img @click="selectSeat(item)"   v-else-if="!item.active"   class="seat-icon" src="../../img/unselect.png"      />
                    <img @click="unselectSeat(item)" v-else                     class="seat-icon" src="../../img/selectActive.png"  />
                    <span>{{item.name}}</span>
                </div>
            </div>

            <div class="layui-row detail-tab">
                <div class="layui-tab layui-tab-card main_borderColor" :style='{"backgroundColor":"#fff","borderRadius":"10px","borderStyle":"solid","borderWidth":"1px"}' style="overflow: hidden;">
                    <ul class="layui-tab-title main_color" :style='{"backgroundColor":"#f2f2f2","fontSize":"14px"}'>
                        <li class="layui-this">详情</li>
                        <li>评论</li>
                    </ul>

                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">
                            <div v-html="myFilters(detail.dianyingContent)"></div>
                        </div>
                        <div class="layui-tab-item">
                            <div class="message-container">
                                <div class="message-list" :style='{"padding":"0 20px 20px","boxShadow":"0 0 0px rgba(255,0,0,.3)","margin":"0","borderColor":"#92d289","backgroundColor":"#fff","borderRadius":"4px","borderWidth":"0","borderStyle":"solid"}'>
                                    <div v-for="(item,index) in dianyingCommentbackDataList" v-bind:key="index" :style='{"padding":"20px 0","boxShadow":"0 0 0px rgba(255,0,0,0)","margin":"0","borderColor":"rgba(0,0,0,.3)","backgroundColor":"#fff","borderRadius":"0","borderWidth":"0 0 1px 0","borderStyle":"solid"}' class="message-item">
                                        <div class="username-container">
                                            <img :src="item.yonghuPhoto" :style='{"boxShadow":"0 0 0px rgba(255,0,0,.3)","margin":"0 10px 0 0","borderColor":"rgba(0,0,0,.3)","borderRadius":"50%","borderWidth":"0","width":"40px","borderStyle":"solid","height":"40px"}' class="avator">
                                            <span style="display: inline-block;" :style='{"padding":"0 10px","boxShadow":"0 0 0px rgba(255,0,0,.3)","margin":"0","borderColor":"rgba(0,0,0,.3)","backgroundColor":"#fff","color":"rgba(6, 82, 121, 1)","borderRadius":"4px","borderWidth":"0","width":"auto","lineHeight":"28px","fontSize":"14px","borderStyle":"solid"}' class="username">
                                                {{item.yonghuName}}
                                            </span>
                                        </div>
                                        <div class="content" style="margin: 0;flex: 1;">
                                            <span class="message main_color" style="display: inline-block;" :style='{"padding":"8px","boxShadow":"0 0 0px rgba(255,0,0,.3)","margin":"8px 0 0 50px","borderColor":"rgba(0,0,0,.3)","backgroundColor":"rgba(255, 0, 0, 0)","borderRadius":"4px","borderWidth":"0","fontSize":"14px","borderStyle":"solid"}'>
                                                评价:{{item.dianyingCommentbackText}}
                                            </span>
                                        </div>
                                        <div v-if="item.replyText" class="content" style="margin: 0;flex: 1;">
                                            <span  class="message sub_color" style="display: inline-block;" :style='{"padding":"8px","boxShadow":"0 0 0px rgba(255,0,0,.3)","margin":"8px 0 0 50px","borderColor":"rgba(0,0,0,.3)","backgroundColor":"rgba(255, 0, 0, 0)","borderRadius":"4px","borderWidth":"0","fontSize":"14px","borderStyle":"solid"}'>
                                                回复:{{item.replyText}}
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="pager" id="dianyingCommentbackPager"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div></div>


<script src="../../layui/layui.js"></script>
<script src="../../js/vue.js"></script>
<!-- 引入element组件库 -->
<script src="../../xznstatic/js/element.min.js"></script>
<!-- 引入element样式 -->
<link rel="stylesheet" href="../../xznstatic/css/element.min.css">
<!-- 组件配置信息 -->
<script src="../../js/config.js"></script>
<!-- 扩展插件配置信息 -->
<script src="../../modules/config.js"></script>
<!-- 工具方法 -->
<script src="../../js/utils.js"></script>

<script>
    Vue.prototype.myFilters = function (msg) {
        if (msg != null) {
            return msg.replace(/\n/g, "<br>");
        } else {
            return "";
        }
    };
    var vue = new Vue({
        el: '#app',
        data: {
            // 轮播图
            swiperList: [],
            // 数据详情
            detail: {
                id: 0
            },
            // 商品标题
            title: '',

            storeupFlag: 0,//收藏 [0为收藏 1已收藏]
                zanFlag: 0,//赞 [0 未赞 1 已赞]
                caiFlag: 0,//踩 [0 未踩 1 已踩]
            //系统推荐
                dianyingRecommendList: [],
                // 当前详情页表
            detailTable: 'dianying',
                // 评价列表
                dianyingCommentbackDataList: [],
                buyZuoweiTime: getCurDate(),
                zuoweiNumberList: [],
                buyZuoweiTimeOptions: {
                    disabledDate(time) {//禁止时间
                        var date = new Date();
                        date.setTime(date.getTime() - 24 * 60 * 60 * 1000);
                        return time.getTime() < date;
                    },
                },
        },
        methods: {
            jump(url) {
                jump(url)
            },
            isAuth(tablename, button) {
                return isFrontAuth(tablename, button)
            },
                // 收藏商品
                addDianyingCollection() {
                    let _this = this;
                    layui.http.request('dianyingCollection/list', 'get', {
                        page: 1,
                        limit: 1,
                            dianyingId: _this.detail.id,
                            dianyingCollectionTypes: 1,
                            yonghuId: localStorage.getItem('userid'),
                    }, (res) => {
                        if (res.data.list.length == 1) {
                            layui.http.requestJson('dianyingCollection/delete', 'post', [res.data.list[0].id], function (res) {
                                layui.layer.msg('取消成功', {
                                    time: 1000,
                                    icon: 5
                                }, function () {
                                    window.location.reload();
                                });
                            });
                            return false;
                        }
                        layui.http.requestJson('dianyingCollection/add', 'post', {
                                yonghuId: localStorage.getItem('userid'),
                                dianyingId: _this.detail.id,
                                dianyingCollectionTypes: 1,
                        }, function (res) {
                            layui.layer.msg('收藏成功', {
                                time: 1000,
                                icon: 6
                            }, function () {
                                window.location.reload();
                            });
                        });
                    });
                },
                // 赞
                zanNumberClick() {
                    let _this = this;
                    layui.http.request('dianyingCollection/list', 'get', {
                        page: 1,
                        limit: 1,
                            dianyingId: _this.detail.id,
                            dianyingCollectionTypes: 2,
                            yonghuId: localStorage.getItem('userid'),
                    }, (res) => {
                        if (res.data.total == 1) {
                            layui.http.requestJson('dianyingCollection/delete', 'post', [res.data.list[0].id], function (res) {
                                layui.http.requestJson(`dianying/update`, 'POST', {
                                    id: _this.detail.id,
                                    zanNumber: _this.detail.zanNumber - 1
                                }, (res1) => {
                                    if (res1.code == 0) {
                                        layui.layer.msg('取消点赞成功', {
                                            time: 1000,
                                            icon: 6
                                        }, function () {
                                            _this.detail.zanNumber = _this.detail.zanNumber - 1;
                                            _this.zanFlag = 0;
                                        });
                                    } else {
                                        layui.layer.msg('取消点赞失败', {
                                            time: 1000,
                                            icon: 5
                                        }, function () {
                                            return false;
                                        });
                                    }
                                });
                            });
                        } else {
                            layui.http.requestJson('dianyingCollection/add', 'post', {
                                    yonghuId: localStorage.getItem('userid'),
                                    dianyingId: _this.detail.id,
                                    dianyingCollectionTypes: 2,
                            }, function (res) {
                                layui.http.requestJson(`dianying/update`, 'POST', {
                                    id: _this.detail.id,
                                    zanNumber: _this.detail.zanNumber + 1
                                }, (res1) => {
                                    if (res1.code == 0) {
                                        layui.layer.msg('点赞成功', {
                                            time: 1000,
                                            icon: 6
                                        }, function () {
                                            _this.detail.zanNumber = _this.detail.zanNumber + 1;
                                            _this.zanFlag = 1;
                                        });
                                    } else {
                                        layui.layer.msg('点赞失败', {
                                            time: 1000,
                                            icon: 5
                                        }, function () {
                                            return false;
                                        });
                                    }
                                });
                            });
                        }
                    });
                },

                // 踩
                caiNumberClick() {
                    let _this = this;
                    layui.http.request('dianyingCollection/list', 'get', {
                        page: 1,
                        limit: 1,
                            dianyingId: _this.detail.id,
                            dianyingCollectionTypes: 3,
                            yonghuId: localStorage.getItem('userid'),
                    }, (res) => {
                        if (res.data.total == 1) {
                            layui.http.requestJson('dianyingCollection/delete', 'post', [res.data.list[0].id], function (res) {
                                layui.http.requestJson(`dianying/update`, 'POST', {
                                    id: _this.detail.id,
                                    caiNumber: _this.detail.caiNumber - 1
                                }, (res1) => {
                                    if (res1.code == 0) {
                                        layui.layer.msg('取消点踩成功', {
                                            time: 1000,
                                            icon: 6
                                        }, function () {
                                            _this.detail.caiNumber = _this.detail.caiNumber - 1;
                                            _this.caiFlag = 0;
                                        });
                                    } else {
                                        layui.layer.msg('取消点踩失败', {
                                            time: 1000,
                                            icon: 5
                                        }, function () {
                                            return false;
                                        });
                                    }
                                });
                            });
                        } else {
                            layui.http.requestJson('dianyingCollection/add', 'post', {
                                    yonghuId: localStorage.getItem('userid'),
                                    dianyingId: _this.detail.id,
                                    dianyingCollectionTypes: 3,
                            }, function (res) {
                                layui.http.requestJson(`dianying/update`, 'POST', {
                                    id: _this.detail.id,
                                    caiNumber: _this.detail.caiNumber + 1
                                }, (res1) => {
                                    if (res1.code == 0) {
                                        layui.layer.msg('点踩成功', {
                                            time: 1000,
                                            icon: 6
                                        }, function () {
                                            _this.detail.caiNumber = _this.detail.caiNumber + 1;
                                            _this.caiFlag = 1;
                                        });
                                    } else {
                                        layui.layer.msg('点踩失败', {
                                            time: 1000,
                                            icon: 5
                                        }, function () {
                                            return false;
                                        });
                                    }
                                });
                            });
                        }
                    });
                },
                // 立即购买
                addDianyingOrder() {
                    //座位list
                    let activeZuoweiList = [];
                    for (let i = 0; i < this.zuoweiNumberList.length; i++) {
                        if (this.zuoweiNumberList[i].active) {
                            activeZuoweiList.push(this.zuoweiNumberList[i].name.replace('号', ''));
                        }
                    }
                    if (activeZuoweiList.length == 0) {
                        layer.msg(`请选择要预定的座位`, {
                            time: 2000,
                            icon: 5
                        });
                        return false;
                    }
                    localStorage.setItem("activeZuoweiList", activeZuoweiList);//座位list
                    localStorage.setItem("buyZuoweiTime", this.buyZuoweiTime);//购买日期
                    localStorage.setItem("dianyingId", this.detail.id);
                    jump('../dianyingOrder/add.html');
                },

    <!-- 座位 -->
		        // 选座座位
                selectSeat(item) {
                    item.active = true;
                },
                // 取消选择座位
                unselectSeat(item) {
                    item.active = false;
                },
                // 提示该座位已经被选择了
                selectTip() {
                    layer.msg(`该座位已被预定`, {
                        time: 2000,
                        icon: 5
                    });
                },
                zuoweiChange() {
                    let _this = this;
                    if (layui.jquery.type(this.buyZuoweiTime) === "date") {//如果类型是日期的话，要格式化成字符串， 否则后台没法查询
                        _this.buyZuoweiTime = layui.util.toDateString(this.buyZuoweiTime, 'yyyy-MM-dd');
                    }
                    layui.http.request(`dianyingOrder/list`, 'get', {
                        page: 1,
                        limit: 100,
                        dianyingId: _this.detail.id,
                        dianyingOrderDelete: 1,
                        buyZuoweiTimeStart: _this.buyZuoweiTime,
                        buyZuoweiTimeEnd: _this.buyZuoweiTime,
                    }, function (res) {
                        //生成默认座位
                        _this.zuoweiNumberList = [];
                        for (let i = 1; i <= _this.detail.zuoweiNumber; i++) {
                            _this.zuoweiNumberList.push({
                                name: `${i}号`,
                                select: false,
                                active: false
                            });
                        }
                        //生成座位被使用
                        if (res.data.list.length > 0) {
                            res.data.list.forEach(element => {
                                if (element.buyZuoweiNumber != null) {
                                    for (let i = 0; i < element.buyZuoweiNumber.split(',').length; i++) {
                                        _this.zuoweiNumberList[element.buyZuoweiNumber.split(',')[i] - 1].select = true;
                                    }
                                }
                            });
                        }
                    });
                },
        }
    });

    layui.use(['layer', 'form', 'element', 'carousel', 'http', 'jquery', 'laypage', 'util'], function () {
        var layer = layui.layer;
        var util = layui.util;
        var element = layui.element;
        var form = layui.form;
        var carousel = layui.carousel;
        var http = layui.http;
        var jquery = layui.jquery;
        var laypage = layui.laypage;

        var limit = 10;

        // 数据ID
        var id = http.getParam('id');
        vue.detail.id = id;
            // 数据信息
            http.request(`${vue.detailTable}/detail/` + id, 'get', {}, function (res) {
                // 详情信息
                vue.detail = res.data;
                vue.title = vue.detail.dianyingName;
                // 轮播图片
                vue.swiperList = vue.detail.dianyingPhoto ? vue.detail.dianyingPhoto.split(",") : [];
                // 轮播图
                vue.$nextTick(() => {
                    carousel.render({
                        elem: '#swiper',
                        width: '420px',
                        height: '400px',
                        arrow: 'hover',
                        anim: 'default',
                        autoplay: 'true',
                        interval: '3000',
                        indicator: 'inside'
                    });
                });

                <!-- 座位初始化 -->
                vue.zuoweiChange();
            });


            // 系统推荐
            http.request(`dianying/list`, 'get', {
                page: 1,
                limit: 5,
                dianyingTypes: vue.detail.dianyingTypes,
                dianyingDelete: 1,
                    shangxiaTypes:
                    vue.detail.shangxiaTypes,
            },

        function (res) {
            vue.dianyingRecommendList = res.data.list;
        }

    )
        ;

            if (localStorage.getItem('userid')) {
                http.request('dianyingCollection/list', 'get', {
                    page: 1,
                    limit: 1,
                        dianyingId: vue.detail.id,
                        yonghuId: localStorage.getItem('userid'),
                }, function (res) {
                    if (res.data.total > 0) {
                        res.data.list.forEach(element => {
                            if (element.dianyingCollectionTypes == 1) {
                                vue.storeupFlag = 1;
                            }
                            if (element.dianyingCollectionTypes == 2) {
                                vue.zanFlag = 1;
                            }
                            if (element.dianyingCollectionTypes == 3) {
                                vue.caiFlag = 1;
                            }
                        });

                    }
                });
            }

            // 获取评价
            http.request(`${vue.detailTable}Commentback/list`, 'get', {
                page: 1,
                limit: limit,
                    dianyingId: vue.detail.id
            }, function (res) {
                vue.dianyingCommentbackDataList = res.data.list;
                // 分页
                laypage.render({
                    elem: 'dianyingCommentbackPager',
                    count: res.data.total,
                    limit: limit,
                    jump: function (obj, first) {
                        //首次不执行
                        if (!first) {
                            http.request(`${vue.detailTable}Commentback/list`, 'get', {
                                page: obj.curr,
                                limit: obj.limit,
                                    dianyingId: vue.detail.id
                            }, function (res) {
                                vue.dianyingCommentbackDataList = res.data.list
                            })
                        }
                    }
                });
            });
    });
</script>
</body>
</html>
